import request from '@/utils/request'
/**
 * 获取退货订单列表
 * @param {*} params
 * @returns
 */
export function getReturnOrderList(params) {
  return request({
    url: '/api/app/orders-return/orders-return-list',
    method: 'get',
    baseURL: public_config.labor_api,
    params
  })
}

/**
 * 按ID获取退货订单详细信息
 * @param {*} id
 * @returns
 */
export function getByIdReturnOrder(id) {
  return request({
    url: `/api/app/orders-return/${id}/orders-return`,
    method: 'get',
    baseURL: public_config.labor_api
  })
}

/**
 * 订单退货审核列表
 * @param {*} params
 * @returns
 */
export function getReturnOrderAuditList(params) {
  return request({
    url: '/api/app/orders-return/orders-return-audit-list',
    method: 'get',
    baseURL: public_config.labor_api,
    params
  })
}

/**
 * 订单退货申请
 * @param {*} data
 * @returns
 */
export function insertReturnOrder(data) {
  return request({
    url: '/api/app/orders-return/orders-return',
    method: 'post',
    baseURL: public_config.labor_api,
    data
  })
}

/**
 * 订单退货审核
 * @param {*} data
 * @returns
 */
export function auditReturnOrder(data) {
  return request({
    url: '/api/app/orders-return/orders-return-audit',
    method: 'post',
    baseURL: public_config.labor_api,
    data
  })
}

/**
 *  订单退货确认完成
 * @param {*} data
 * @returns
 */
export function confirmReturnOrder(data) {
  return request({
    url: '/api/app/orders-return/orders-return-confirm',
    method: 'post',
    baseURL: public_config.labor_api,
    data
  })
}

/**
 * 按Id取消退货订单
 * @param {*} id
 * @returns
 */
export function cancelByIdReturnOrder(id) {
  return request({
    url: `/api/app/orders-return/orders-return-canceled/${id}`,
    method: 'post',
    baseURL: public_config.labor_api
  })
}

/**
 * 按Id删除已取消的订单
 * @param {*} id
 * @returns
 */
export function deleteByIdReturnOrder(id) {
  return request({
    url: `/api/app/orders-return/orders-return-delete/${id}`,
    method: 'post',
    baseURL: public_config.labor_api
  })
}

export function balanceReturnOrder(data) {
  return request({
    url: '/api/app/orders-return/balance',
    method: 'post',
    baseURL: public_config.labor_api,
    data
  })
}
